<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; utf-8">
<title>员工基本信息列表</title>
    <script src="${pageContext.request.contextPath }/js/jquery-2.1.3.min.js"></script>

    <style>
        *{padding: 0; margin: 0}
        .box{
            position: fixed;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.2);
            display: none;
        }
        .box1{
            width: 500px;
            height: 500px;
            position: fixed;left: 50%; top: 25%;
            margin-left: -250px;
            border: 1px solid #000000;
        }
    </style>
    <script>
 
    </script>
</head>
<body>
   <div class="box">
        <div class="box1">
            <a href="javascript:;" onclick="jQuery('.box').hide()" class="close">关闭</a>
            当前用户：${username }
	<c:if test="${username!=null }">
		<a href="${pageContext.request.contextPath }/user/logout.action">退出</a>
	</c:if>
	<form name="stuffForm"
		action="${pageContext.request.contextPath }/stuff/updateStuffInfo.action"
		method="post" enctype="multipart/form-data">
		<table width="100%" border=1>
			<tr>
				<td>idStuff</td>
				<td><input type="text" name="idStuff" value="${stuff.idStuff }" /></td>
				<td>stuffnumber</td>
				<td><input type="text" name="stuffnumber"
					value="${stuff.stuffnumber }" /></td>
			</tr>
			<tr>
				<td>name</td>
				<td><input type="text" name="name" value="${stuff.name }" /></td>
				<td>sex</td>
				<td><input type="text" name="sex" value="${stuff.sex }" /></td>
			</tr>
			<tr>
				<td>idNation</td>
				<td><select name="idNation">
						<c:forEach items="${nations }" var="nation">
							<option value="${nation.idNation }" 
							<c:if test="${nation.idNation==stuff.idNation  }">selected="selected" </c:if> >${nation.name }</option>
						</c:forEach>
				</select></td>
				<td>birthday</td>
				<td><input type="text" name="birthday"
					value="<fmt:formatDate value='${stuff.birthday }'
							pattern='yyyy-MM-dd'/> " /></td>
			</tr>
			<tr>
				<td>图片</td>
				<td>
				<c:if test="${stuff.imgsrc!=null }">
					<!-- 保存原来的文件，否则当没有选择新文件时，由于pic参数值没有修改，会变为null -->
					<input type="hidden" name="imgsrc" value="${stuff.imgsrc }" />
					<img src="/pic/${stuff.imgsrc }" width=100 height=100 />
					<br />
				</c:if>
				<input type="file" name="pic_file" /> 
				<!-- 显示错误信息 --> 
				<c:if test="${fileError!=null}">${fileError }</c:if>
				</td>
			</tr>
		</table>
		<input type="submit" value="提交修改" />
	</form>
        </div>
    </div>
    <a href="javascript:;" onclick="jQuery('.box').show()" class="show">显示</a>
	
</body>
</html>